package com.njbdqn.myshops.model.service;

import com.njbdqn.myshops.model.mapper.GoodsMapper;
import com.njbdqn.myshops.pojo.Goods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class GoodsService {
    @Autowired
    private GoodsMapper gm;

    public Map findCurrentData(int page) {
        Map map = new HashMap();
        map.put("datas",gm.findCurrentData(page));
        map.put("size",gm.getTotal());
        return map;
    }

    public Goods findById(int good_id) {
        return gm.findById(good_id);
    }
}
